<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmViewPayment">
        <f:view>
            <p:contextMenu for="dlgViewPayment">
                <p:menuitem value="New"
                            icon="ui-icon-search"
                            oncomplete="wgCreatePayment.show();"
                            update=":frmCreatePayment:dlgCreatePayment"
                            />

                <p:menuitem value="Delete"
                            icon="ui-icon ui-icon-arrowreturnthick-1-e"
                            oncomplete="wgConfirmation.show();"
                            >                    
                </p:menuitem>




                <p:submenu label="Export" icon="ui-icon-extlink">
                    <p:submenu label="All Data">
                        <p:menuitem value="To Excel 2010"  ajax="false"  >
                            <p:dataExporter type="xls" target="dtViewPayment"  fileName="Payment" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewPayment" fileName="Payment"/>
                        </p:menuitem>
                        <p:menuitem value="To PDF" ajax="false" >
                            <p:dataExporter type="pdf" target="dtViewPayment" fileName="Payment"/>
                        </p:menuitem>
                    </p:submenu>
                    <p:submenu label="All Data in Page">
                        <p:menuitem value="To Excel 2010" ajax="false" >
                            <p:dataExporter type="xls" target="dtViewPayment" fileName="Payment" pageOnly="true" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewPayment" fileName="Payment" pageOnly="true"/>
                        </p:menuitem>
                    </p:submenu>
                </p:submenu>
            </p:contextMenu>
            <p:dialog id="dlgViewPayment"
                      widgetVar="wgViewPayment"
                      header="Payment Information Management"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip"
                      >
                <p:dataTable id="dtViewPayment"
                             value="#{paymentManagement.list}"
                             rowKey="#{item.payId}"
                             selection="#{paymentManagement.selectPayment}"
                             selectionMode="single"

                             filteredValue="#{paymentManagement.filteredList}"
                             paginator="true"
                             rows="5"
                             var="item">



                    <p:column sortBy="#{item.hospital.hospitalName}"
                              filterBy="#{item.hospital.hospitalName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Hospital"/>
                        </f:facet>
                        <h:outputText value="#{item.hospital.hospitalName}"/>
                    </p:column>
                    <p:column sortBy="#{item.banking.bankName}"
                              filterBy="#{item.banking.bankName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Banking"/>
                        </f:facet>
                        <h:outputText value="#{item.banking.bankName}"/>
                    </p:column>
                </p:dataTable>
            </p:dialog>
        </f:view>
    </h:form>
</html>
